# $Id: Makefile 104 2005-07-26 03:52:28Z clsung $
CC = g++
DFLAGS = -Wall
INCLUDE= -I/usr/include -I/usr/local/include
LIB = -L/usr/local/lib
CFLAGS = -c -O2 -pipe
OFLAGS = -o
EXECNAME = pi_p pi pi_o

test:	pi pi_o pi_p
	./pi; ./pi_o; ./pi_p

all: ${EXECNAME}

pi_pthread.o:	pi_pthread.cpp
	${CC} ${INCLUDE} ${LIB} -pthread ${DFLAGS} ${CFLAGS} pi_pthread.cpp

pi.o:	pi.cpp
	${CC} ${INCLUDE} ${DFLAGS} ${CFLAGS} pi.cpp

pi_openmp.o:	pi_openmp.cpp
	${CC} ${INCLUDE} ${LIB} -fopenmp ${DFLAGS} ${CFLAGS} pi_openmp.cpp

pi_p:	pi_pthread.o
	${CC} pi_pthread.o ${LIB} -pthread ${OFLAGS} pi_p

pi:	pi.o
	${CC} pi.o ${LIB} ${OFLAGS} pi

pi_o:	pi_openmp.o
	${CC} pi_openmp.o -O2 ${LIB} -fopenmp ${OFLAGS} pi_o

clean:
	rm *.o ${EXECNAME}
